home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 48 / PC Gamer IT CD 48 1-2.iso / age2 / AoE2demo.exe / 1033 / CABFILE / MSGAME.CAB / Data / gamedata.drs / Unnamed File 000009.bina < prev    next >
Text File  |  1999-10-01  |  19KB  |  1,019 lines

  1. (defrule
  2.     (timer-triggered  t-production)
  3. =>
  4.     (generate-random-number 3)
  5. )
  6.  
  7. (defrule
  8.     (timer-triggered  t-production)
  9.     (or
  10.         (goal military-parity NO)
  11.         (random-number == 1)
  12.     )
  13. =>
  14.     (set-goal combat-supp UNIT20)
  15. )
  16.  
  17. ;************************
  18. (defrule
  19.     (timer-triggered  t-production)
  20. =>
  21.     (generate-random-number 12)
  22. )
  23.  
  24. ;feudal-age
  25. (defrule
  26.     (goal combat-supp UNIT20)
  27.     (current-age == feudal-age)
  28.     (timer-triggered  t-production)
  29.     (random-number <= 5)
  30.     (or
  31.         (or
  32.             (goal combat-arm INFANTRY)
  33.             (goal combat-arm CAVALRY)
  34.         )
  35.         (goal pre-unique-arm INFANTRY)
  36.     )
  37. =>
  38.     (set-goal combat-supp ARCHER)
  39. )
  40.  
  41. (defrule
  42.     (goal combat-supp UNIT20)
  43.     (current-age == feudal-age)
  44.     (timer-triggered  t-production)
  45.     (random-number >= 6)
  46.     (random-number <= 10)
  47.     (or
  48.         (or
  49.             (goal combat-arm CAVARCHER)
  50.             (goal combat-arm ARCHER)
  51.         )
  52.         (goal pre-unique-arm ARCHER)
  53.     )
  54. =>
  55.     (set-goal combat-supp INFANTRY)
  56. )
  57.  
  58. (defrule
  59.     (goal combat-arm LIGHTCAV)
  60.     (goal combat-supp UNIT20)
  61.     (current-age == feudal-age)
  62.     (timer-triggered  t-production)
  63.     (random-number == 11)
  64. =>
  65.     (set-goal combat-supp INFANTRY)
  66. )
  67.  
  68. (defrule
  69.     (goal combat-arm LIGHTCAV)
  70.     (goal combat-supp UNIT20)
  71.     (current-age == feudal-age)
  72.     (timer-triggered  t-production)
  73.     (random-number == 12)
  74. =>
  75.     (set-goal combat-supp ARCHER)
  76. )
  77.  
  78. ;castle-age & higher
  79. ;if Infantry is the main build
  80. (defrule
  81.     (goal combat-arm INFANTRY)
  82.     (goal combat-supp UNIT20)
  83.     (timer-triggered  t-production)
  84.     (random-number == 1)
  85. =>
  86.     (set-goal combat-supp CAVALRY)
  87. )
  88. (defrule
  89.     (goal combat-supp UNIT20)
  90.     (timer-triggered  t-production)
  91.     (random-number == 1)
  92.     (building-type-count castle > 0)
  93.     (or
  94.         (or
  95.             (civ-selected celtic)
  96.             (civ-selected frankish)
  97.         )
  98.         (or
  99.             (or
  100.                 (civ-selected gothic)
  101.                 (civ-selected japanese)
  102.             )
  103.             (or
  104.                 (civ-selected teutonic)
  105.                 (civ-selected viking)
  106.             )
  107.         )
  108.     )
  109. =>
  110.     (set-goal combat-supp CAVALRY)
  111. )
  112.  
  113. (defrule
  114.     (goal combat-arm INFANTRY)
  115.     (goal combat-supp UNIT20)
  116.     (timer-triggered  t-production)
  117.     (random-number <= 3)
  118. =>
  119.     (set-goal combat-supp LIGHTCAV)
  120. )
  121.  
  122. (defrule
  123.     (goal combat-supp UNIT20)
  124.     (timer-triggered  t-production)
  125.     (random-number <= 3)
  126.     (building-type-count castle > 0)
  127.     (or
  128.         (or
  129.             (civ-selected celtic)
  130.             (civ-selected frankish)
  131.         )
  132.         (or
  133.             (or
  134.                 (civ-selected gothic)
  135.                 (civ-selected japanese)
  136.             )
  137.             (or
  138.                 (civ-selected teutonic)
  139.                 (civ-selected viking)
  140.             )
  141.         )
  142.     )
  143. =>
  144.     (set-goal combat-supp LIGHTCAV)
  145. )
  146.  
  147. (defrule
  148.     (goal combat-arm INFANTRY)
  149.     (goal combat-supp UNIT20)
  150.     (timer-triggered  t-production)
  151.     (random-number <= 6)
  152. =>
  153.     (set-goal combat-supp CAVARCHER)
  154. )
  155.  
  156. (defrule
  157.     (goal combat-supp UNIT20)
  158.     (timer-triggered  t-production)
  159.     (random-number <= 6)
  160.     (building-type-count castle > 0)
  161.     (or
  162.         (or
  163.             (civ-selected celtic)
  164.             (civ-selected frankish)
  165.         )
  166.         (or
  167.             (or
  168.                 (civ-selected gothic)
  169.                 (civ-selected japanese)
  170.             )
  171.             (or
  172.                 (civ-selected teutonic)
  173.                 (civ-selected viking)
  174.             )
  175.         )
  176.     )
  177. =>
  178.     (set-goal combat-supp CAVARCHER)
  179. )
  180.  
  181. (defrule
  182.     (goal combat-arm INFANTRY)
  183.     (goal combat-supp UNIT20)
  184.     (timer-triggered  t-production)
  185.     (random-number <= 10)
  186. =>
  187.     (set-goal combat-supp ARCHER)
  188. )
  189.  
  190. (defrule
  191.     (goal combat-supp UNIT20)
  192.     (timer-triggered  t-production)
  193.     (random-number <= 10)
  194.     (building-type-count castle > 0)
  195.     (or
  196.         (or
  197.             (civ-selected celtic)
  198.             (civ-selected frankish)
  199.         )
  200.         (or
  201.             (or
  202.                 (civ-selected gothic)
  203.                 (civ-selected japanese)
  204.             )
  205.             (or
  206.                 (civ-selected teutonic)
  207.                 (civ-selected viking)
  208.             )
  209.         )
  210.     )
  211. =>
  212.     (set-goal combat-supp ARCHER)
  213. )
  214.  
  215. (defrule
  216.     (goal combat-arm INFANTRY)
  217.     (goal combat-supp UNIT20)
  218.     (timer-triggered  t-production)
  219.     (random-number <= 12)
  220. =>
  221.     (set-goal combat-supp SCORPION)
  222. )
  223.  
  224. (defrule
  225.     (goal combat-supp UNIT20)
  226.     (timer-triggered  t-production)
  227.     (random-number <= 12)
  228.     (building-type-count castle > 0)
  229.     (or
  230.         (or
  231.             (civ-selected celtic)
  232.             (civ-selected frankish)
  233.         )
  234.         (or
  235.             (or
  236.                 (civ-selected gothic)
  237.                 (civ-selected japanese)
  238.             )
  239.             (or
  240.                 (civ-selected teutonic)
  241.                 (civ-selected viking)
  242.             )
  243.         )
  244.     )
  245. =>
  246.     (set-goal combat-supp SCORPION)
  247. )
  248.  
  249. ;if Cavalry is the main build
  250. (defrule
  251.     (goal combat-supp UNIT20)
  252.     (timer-triggered  t-production)
  253.     (random-number <= 2)
  254.     (or
  255.         (goal combat-arm CAVALRY)
  256.         (and
  257.             (building-type-count castle > 0)
  258.             (or
  259.                 (civ-selected byzantine)
  260.                 (or
  261.                     (civ-selected persian)
  262.                     (civ-selected saracen)
  263.                 )
  264.             )
  265.         )
  266.     )
  267. =>
  268.     (set-goal combat-supp INFANTRY)
  269. )
  270.  
  271. (defrule
  272.     (goal combat-supp UNIT20)
  273.     (timer-triggered  t-production)
  274.     (random-number <= 9)
  275.     (or
  276.         (goal combat-arm CAVALRY)
  277.         (and
  278.             (building-type-count castle > 0)
  279.             (or
  280.                 (civ-selected byzantine)
  281.                 (or
  282.                     (civ-selected persian)
  283.                     (civ-selected saracen)
  284.                 )
  285.             )
  286.         )
  287.     )
  288. =>
  289.     (set-goal combat-supp CAVARCHER)
  290. )
  291.  
  292. (defrule
  293.     (goal combat-supp UNIT20)
  294.     (timer-triggered  t-production)
  295.     (random-number <= 11)
  296.     (or
  297.         (goal combat-arm CAVALRY)
  298.         (and
  299.             (building-type-count castle > 0)
  300.             (or
  301.                 (civ-selected byzantine)
  302.                 (or
  303.                     (civ-selected persian)
  304.                     (civ-selected saracen)
  305.                 )
  306.             )
  307.         )
  308.     )
  309. =>
  310.     (set-goal combat-supp ARCHER)
  311. )
  312.  
  313. (defrule
  314.     (goal combat-supp UNIT20)
  315.     (timer-triggered  t-production)
  316.     (random-number == 12)
  317.     (or
  318.         (goal combat-arm CAVALRY)
  319.         (and
  320.             (building-type-count castle > 0)
  321.             (or
  322.                 (civ-selected byzantine)
  323.                 (or
  324.                     (civ-selected persian)
  325.                     (civ-selected saracen)
  326.                 )
  327.             )
  328.         )
  329.     )
  330. =>
  331.     (set-goal combat-supp SCORPION)
  332. )
  333.  
  334. ;if Light Cav is the main build
  335. (defrule
  336.     (goal combat-arm LIGHTCAV)
  337.     (goal combat-supp UNIT20)
  338.     (timer-triggered  t-production)
  339.     (random-number == 1)
  340. =>
  341.     (set-goal combat-supp INFANTRY)
  342. )
  343.  
  344. (defrule
  345.     (goal combat-arm LIGHTCAV)
  346.     (goal combat-supp UNIT20)
  347.     (timer-triggered  t-production)
  348.     (random-number <= 6)
  349. =>
  350.     (set-goal combat-supp CAVALRY)
  351. )
  352.  
  353. (defrule
  354.     (goal combat-arm LIGHTCAV)
  355.     (goal combat-supp UNIT20)
  356.     (timer-triggered  t-production)
  357.     (random-number <= 10)
  358. =>
  359.     (set-goal combat-supp CAVARCHER)
  360. )
  361.  
  362. (defrule
  363.     (goal combat-arm LIGHTCAV)
  364.     (goal combat-supp UNIT20)
  365.     (timer-triggered  t-production)
  366.     (random-number == 11)
  367. =>
  368.     (set-goal combat-supp ARCHER)
  369. )
  370.  
  371. (defrule
  372.     (goal combat-arm LIGHTCAV)
  373.     (goal combat-supp UNIT20)
  374.     (timer-triggered  t-production)
  375.     (random-number == 12)
  376. =>
  377.     (set-goal combat-supp SCORPION)
  378. )
  379.  
  380. ;if Cav Archers are the main build
  381. (defrule
  382.     (goal combat-supp UNIT20)
  383.     (timer-triggered  t-production)
  384.     (random-number <= 4)
  385.     (or
  386.         (goal combat-arm CAVARCHER)
  387.         (and
  388.             (building-type-count castle > 0)
  389.             (civ-selected mongol)
  390.         )
  391.     )
  392. =>
  393.     (set-goal combat-supp INFANTRY)
  394. )
  395.  
  396. (defrule
  397.     (goal combat-supp UNIT20)
  398.     (timer-triggered  t-production)
  399.     (random-number <= 8)
  400.     (or
  401.         (goal combat-arm CAVARCHER)
  402.         (and
  403.             (building-type-count castle > 0)
  404.             (civ-selected mongol)
  405.         )
  406.     )
  407. =>
  408.     (set-goal combat-supp CAVALRY)
  409. )
  410.  
  411. (defrule
  412.     (goal combat-supp UNIT20)
  413.     (timer-triggered  t-production)
  414.     (random-number <= 12)
  415.     (or
  416.         (goal combat-arm CAVARCHER)
  417.         (and
  418.             (building-type-count castle > 0)
  419.             (civ-selected mongol)
  420.         )
  421.     )
  422. =>
  423.     (set-goal combat-supp LIGHTCAV)
  424. )
  425.  
  426. ;if Archers are the main build
  427. (defrule
  428.     (goal combat-supp UNIT20)
  429.     (timer-triggered  t-production)
  430.     (random-number <= 4)
  431.     (or
  432.         (goal combat-arm ARCHER)
  433.         (and
  434.             (building-type-count castle > 0)
  435.             (or
  436.                 (or
  437.                     (civ-selected briton)
  438.                     (civ-selected chinese)
  439.                 )
  440.                 (or
  441.                     (civ-selected mongol)
  442.                     (civ-selected turkish)
  443.                 )
  444.             )
  445.         )
  446.     )
  447. =>
  448.     (set-goal combat-supp INFANTRY)
  449. )
  450.  
  451. (defrule
  452.     (goal combat-supp UNIT20)
  453.     (timer-triggered  t-production)
  454.     (random-number <= 7)
  455.     (or
  456.         (goal combat-arm ARCHER)
  457.         (and
  458.             (building-type-count castle > 0)
  459.             (or
  460.                 (or
  461.                     (civ-selected briton)
  462.                     (civ-selected chinese)
  463.                 )
  464.                 (or
  465.                     (civ-selected mongol)
  466.                     (civ-selected turkish)
  467.                 )
  468.             )
  469.         )
  470.     )
  471. =>
  472.     (set-goal combat-supp CAVALRY)
  473. )
  474.  
  475. (defrule
  476.     (goal combat-supp UNIT20)
  477.     (timer-triggered  t-production)
  478.     (random-number <= 11)
  479.     (or
  480.         (goal combat-arm ARCHER)
  481.         (and
  482.             (building-type-count castle > 0)
  483.             (or
  484.                 (or
  485.                     (civ-selected briton)
  486.                     (civ-selected chinese)
  487.                 )
  488.                 (or
  489.                     (civ-selected mongol)
  490.                     (civ-selected turkish)
  491.                 )
  492.             )
  493.         )
  494.     )
  495. =>
  496.     (set-goal combat-supp LIGHTCAV)
  497. )
  498.  
  499. (defrule
  500.     (goal combat-supp UNIT20)
  501.     (timer-triggered  t-production)
  502.     (random-number == 12)
  503.     (or
  504.         (goal combat-arm ARCHER)
  505.         (and
  506.             (building-type-count castle > 0)
  507.             (or
  508.                 (or
  509.                     (civ-selected briton)
  510.                     (civ-selected chinese)
  511.                 )
  512.                 (or
  513.                     (civ-selected mongol)
  514.                     (civ-selected turkish)
  515.                 )
  516.             )
  517.         )
  518.     )
  519. =>
  520.     (set-goal combat-supp SCORPION)
  521. )
  522.  
  523. ;periodically check how we're doing!
  524. (defrule
  525.     (timer-triggered  t-production)
  526. =>
  527.     (disable-timer t-production)
  528.     (enable-timer t-production 300)
  529. )
  530.  
  531. ;*******************************************************
  532. ;INFANTRY ARMY 
  533. (defrule
  534.     (soldier-count < ten-percent-pop)
  535.     (building-type-count stable == 0)
  536.     (building-type-count archery-range == 0)
  537.     (building-type-count castle == 0)
  538.     (players-military-population any-enemy >= ten-percent-pop)
  539.     (can-train militiaman)
  540. =>
  541.     (train militiaman)
  542.     (chat-local-to-self "emergency militia")
  543. )
  544.  
  545. (defrule
  546.     (goal rush-control RUSHING)
  547.     (soldier-count < ten-percent-pop)
  548.     (can-train-with-escrow militiaman-line)
  549.     (nor
  550.         (can-train militiaman-line)
  551.         (goal upgrade-conflict NOTICE)
  552.     )
  553.     (or
  554.         (goal combat-arm INFANTRY)
  555.         (goal pre-unique-arm INFANTRY)
  556.     )
  557. =>
  558.     (release-escrow food)
  559.     (release-escrow gold)
  560.     (train militiaman-line)
  561.     (set-goal secondary-build 0)
  562. )
  563.  
  564. (defrule
  565.     (population < unit-max)
  566.     (can-train militiaman-line)
  567.     (or
  568.         (goal combat-arm INFANTRY)
  569.         (goal pre-unique-arm INFANTRY)
  570.     )
  571. =>
  572.     (train militiaman-line)
  573.     (set-goal secondary-build 0)
  574. )
  575.  
  576. (defrule
  577.     (goal secondary-build 0)
  578.     (goal combat-supp INFANTRY)
  579.     (population < unit-max)
  580.     (can-train militiaman-line)
  581. =>
  582.     (train militiaman-line)
  583.     (set-goal secondary-build 1)
  584. )
  585.  
  586. ;********************************************************************
  587. ;CAVALRY ARMY == goal combat-arm CAVALRY & goal combat-supp CAVALRY 
  588. (defrule
  589.     (goal rush-control RUSHING)
  590.     (current-age < castle-age)
  591.     (soldier-count < ten-percent-pop)
  592.     (can-train-with-escrow militiaman-line)
  593.     (nor
  594.         (can-train militiaman-line)
  595.         (goal upgrade-conflict NOTICE)
  596.     )
  597.     (or
  598.         (goal combat-arm CAVALRY)
  599.         (goal pre-unique-arm CAVALRY)
  600.     )
  601. =>
  602.     (release-escrow food)
  603.     (release-escrow gold)
  604.     (train militiaman-line)
  605.     (set-goal secondary-build 0)
  606. )
  607.  
  608. (defrule
  609.     (goal rush-control RUSHING)
  610.     (soldier-count < ten-percent-pop)
  611.     (can-train-with-escrow knight-line)
  612.     (nor
  613.         (can-train knight-line)
  614.         (goal upgrade-conflict NOTICE)
  615.     )
  616.     (or
  617.         (goal combat-arm CAVALRY)
  618.         (goal pre-unique-arm CAVALRY)
  619.     )
  620. =>
  621.     (release-escrow food)
  622.     (release-escrow gold)
  623.     (train knight-line)
  624.     (set-goal secondary-build 0)
  625. )
  626.  
  627. (defrule
  628.     (current-age == feudal-age)
  629.     (soldier-count < twenty-percent-pop)
  630.     (players-military-population any-enemy >= ten-percent-pop)
  631.     (or
  632.         (goal combat-arm CAVALRY)
  633.         (goal pre-unique-arm CAVALRY)
  634.     )
  635.     (can-train militiaman-line)
  636. =>
  637.     (train militiaman-line)
  638.     (set-goal secondary-build 0)
  639. )
  640.  
  641. (defrule
  642.     (population < unit-max)
  643.     (can-train knight-line)
  644.     (or
  645.         (goal combat-arm CAVALRY)
  646.         (goal pre-unique-arm CAVALRY)
  647.     )
  648. =>
  649.     (train knight-line)
  650.     (set-goal secondary-build 0)
  651. )
  652.  
  653. (defrule
  654.     (goal secondary-build 0)
  655.     (goal combat-supp CAVALRY)
  656.     (population < unit-max)
  657.     (can-train knight-line)
  658. =>
  659.     (train knight-line)
  660.     (set-goal secondary-build 1)
  661. )
  662.  
  663. ;********************************************************************
  664. ;LIGHT CAV ARMY == goal combat-arm LIGHTCAV & goal combat-supp LIGHTCAV 
  665. (defrule
  666.     (goal rush-control RUSHING)
  667.     (goal combat-arm LIGHTCAV)
  668.     (soldier-count < ten-percent-pop)
  669.     (can-train-with-escrow scout-cavalry-line)
  670.     (nor
  671.         (can-train scout-cavalry-line)
  672.         (goal upgrade-conflict NOTICE)
  673.     )
  674. =>
  675.     (release-escrow food)
  676.     (train scout-cavalry-line)
  677.     (set-goal secondary-build 0)
  678. )
  679.  
  680. (defrule
  681.     (goal combat-arm LIGHTCAV)
  682.     (population < unit-max)
  683.     (can-train light-cavalry)
  684.     (or
  685.         (current-age == castle-age)
  686.         (not (can-afford-unit knight-line) )
  687.     )
  688. =>
  689.     (train light-cavalry)
  690.     (set-goal secondary-build 0)
  691. )
  692.  
  693. (defrule
  694.     (goal combat-arm LIGHTCAV)
  695.     (current-age == imperial-age)
  696.     (population < unit-max)
  697.     (can-train knight-line)
  698. =>
  699.     (train knight-line)
  700.     (set-goal secondary-build 0)
  701. )
  702.  
  703. (defrule
  704.     (goal secondary-build 0)
  705.     (population < unit-max)
  706.     (can-train light-cavalry)
  707.     (or
  708.         (goal combat-supp LIGHTCAV)
  709.         (and
  710.             (goal combat-arm LIGHTCAV)
  711.             (current-age == imperial-age)
  712.         )
  713.     )
  714. =>
  715.     (train light-cavalry)
  716.     (set-goal secondary-build 1)
  717. )
  718.  
  719. ;********************************************************************
  720. ;CAV ARCHER ARMY == goal combat-arm CAVARCHER & goal combat-supp CAVARCHER 
  721. (defrule
  722.     (goal rush-control RUSHING)
  723.     (current-age == feudal-age)
  724.     (soldier-count < ten-percent-pop)
  725.     (can-train-with-escrow archer)
  726.     (nor
  727.         (can-train archer)
  728.         (goal upgrade-conflict NOTICE)
  729.     )
  730.     (or
  731.         (goal combat-arm CAVARCHER)
  732.         (goal pre-unique-arm CAVARCHER)
  733.     )
  734. =>
  735.     (release-escrow wood)
  736.     (release-escrow gold)
  737.     (train archer)
  738.     (set-goal secondary-build 0)
  739. )
  740.  
  741. (defrule
  742.     (goal rush-control RUSHING)
  743.     (soldier-count < ten-percent-pop)
  744.     (can-train-with-escrow cavalry-archer-line)
  745.     (nor
  746.         (can-train cavalry-archer-line)
  747.         (goal upgrade-conflict NOTICE)
  748.     )
  749.     (or
  750.         (goal combat-arm CAVARCHER)
  751.         (goal pre-unique-arm CAVARCHER)
  752.     )
  753. =>
  754.     (release-escrow wood)
  755.     (release-escrow gold)
  756.     (train cavalry-archer-line)
  757.     (set-goal secondary-build 0)
  758. )
  759.  
  760. (defrule
  761.     (current-age == feudal-age)
  762.     (soldier-count < twenty-percent-pop)
  763.     (can-train-with-escrow archer-line)
  764.     (not (can-train archer-line) )
  765.     (or
  766.         (goal rush-control RUSHING)
  767.         (players-military-population any-enemy >= ten-percent-pop)
  768.     )
  769.     (or
  770.         (goal combat-arm CAVARCHER)
  771.         (goal pre-unique-arm CAVARCHER)
  772.     )
  773. =>
  774.     (train archer-line)
  775.     (set-goal secondary-build 0)
  776. )
  777.  
  778. (defrule
  779.     (current-age == feudal-age)
  780.     (soldier-count < twenty-percent-pop)
  781.     (can-train-with-escrow archer-line)
  782.     (not (can-train archer-line) )
  783.     (or
  784.         (goal rush-control RUSHING)
  785.         (players-military-population any-enemy >= ten-percent-pop)
  786.     )
  787.     (or
  788.         (goal combat-arm CAVARCHER)
  789.         (goal pre-unique-arm CAVARCHER)
  790.     )
  791. =>
  792.     (train archer-line)
  793.     (set-goal secondary-build 0)
  794. )
  795.  
  796. (defrule
  797.     (population < unit-max)
  798.     (can-train cavalry-archer-line)
  799.     (or
  800.         (goal combat-arm CAVARCHER)
  801.         (goal pre-unique-arm CAVARCHER)
  802.     )
  803. =>
  804.     (train cavalry-archer-line)
  805.     (set-goal secondary-build 0)
  806. )
  807.  
  808. (defrule
  809.     (goal secondary-build 0)
  810.     (goal combat-supp CAVARCHER)
  811.     (population < unit-max)
  812.     (can-train cavalry-archer-line)
  813. =>
  814.     (train cavalry-archer-line)
  815.     (set-goal secondary-build 1)
  816. )
  817.  
  818. ;*******************************************************
  819. ;HAND-CANNONEERS 
  820. (defrule
  821.     (population < unit-max)
  822.     (can-train hand-cannoneer)
  823.     (or
  824.         (goal combat-arm ARCHER)
  825.         (goal pre-unique-arm ARCHER)
  826.     )
  827. =>
  828.     (train hand-cannoneer)
  829.     (set-goal secondary-build 0)
  830. )
  831.  
  832. (defrule
  833.     (goal secondary-build 0)
  834.     (goal combat-supp ARCHER)
  835.     (population < unit-max)
  836.     (can-train hand-cannoneer)
  837. =>
  838.     (train hand-cannoneer)
  839.     (set-goal secondary-build 1)
  840. )
  841.  
  842.  
  843. ;*******************************************************
  844. ;ARCHER ARMY == goal combat-arm ARCHER & goal combat-supp ARCHER
  845. (defrule
  846.     (goal rush-control RUSHING)
  847.     (soldier-count < ten-percent-pop)
  848.     (can-train-with-escrow archer-line)
  849.     (nor
  850.         (can-train archer)
  851.         (goal upgrade-conflict NOTICE)
  852.     )
  853.     (or
  854.         (goal combat-arm ARCHER)
  855.         (goal pre-unique-arm ARCHER)
  856.     )
  857. =>
  858.     (release-escrow wood)
  859.     (release-escrow gold)
  860.     (train archer-line)
  861.     (set-goal secondary-build 0)
  862. )
  863.  
  864. (defrule
  865.     (population < unit-max)
  866.     (can-train archer-line)
  867.     (not (unit-available hand-cannoneer) )
  868.     (or
  869.         (goal combat-arm ARCHER)
  870.         (goal pre-unique-arm ARCHER)
  871.     )
  872. =>
  873.     (train archer-line)
  874.     (set-goal secondary-build 0)
  875. )
  876.  
  877. (defrule
  878.     (goal secondary-build 0)
  879.     (goal combat-supp ARCHER)
  880.     (population < unit-max)
  881.     (can-train archer-line)
  882. =>
  883.     (train archer-line)
  884.     (set-goal secondary-build 1)
  885. )
  886.  
  887. ;*******************************************************
  888. ;SCORPION SUPPORT == goal combat-supp SCORPION
  889. (defrule
  890.     (goal secondary-build 0)
  891.     (goal combat-supp SCORPION)
  892.     (population < unit-max)
  893.     (can-train scorpion-line)
  894. =>
  895.     (train scorpion-line)
  896.     (set-goal secondary-build 1)
  897. )
  898.  
  899. (defrule
  900.     (goal secondary-build 0)
  901.     (goal combat-supp SCORPION)
  902.     (population < unit-max)
  903.     (building-type-count siege-workshop == 0)
  904.     (can-train militiaman-line)
  905. =>
  906.     (train militiaman-line)
  907.     (set-goal secondary-build 1)
  908. )
  909.  
  910. ;*******************************************************
  911. ;UNIQUE UNITS! == goal combat-arm UNIQUE
  912.  
  913. (defrule
  914.     (goal rush-control RUSHING)
  915.     (goal combat-arm UNIQUE)
  916.     (soldier-count < ten-percent-pop)
  917.     (can-train-with-escrow my-unique-unit-line)
  918.     (nor
  919.         (can-train my-unique-unit-line)
  920.         (goal upgrade-conflict NOTICE)
  921.     )
  922.     (or
  923.         (civ-selected mongol)
  924.         (or
  925.             (civ-selected briton)
  926.             (civ-selected chinese)
  927.         )
  928.     )
  929. =>
  930.     (release-escrow wood)
  931.     (release-escrow gold)
  932.     (train my-unique-unit-line)
  933.     (set-goal secondary-build 0)
  934. )
  935.  
  936. (defrule
  937.     (goal rush-control RUSHING)
  938.     (goal combat-arm UNIQUE)
  939.     (soldier-count < ten-percent-pop)
  940.     (can-train-with-escrow my-unique-unit-line)
  941.     (nor
  942.         (can-train my-unique-unit-line)
  943.         (goal upgrade-conflict NOTICE)
  944.     )
  945.     (nor
  946.         (civ-selected mongol)
  947.         (or
  948.             (civ-selected briton)
  949.             (civ-selected chinese)
  950.         )
  951.     )
  952. =>
  953.     (release-escrow food)
  954.     (release-escrow gold)
  955.     (train my-unique-unit-line)
  956.     (set-goal secondary-build 0)
  957. )
  958.  
  959. (defrule
  960.     (goal combat-arm UNIQUE)
  961.     (population < unit-max)
  962.     (can-train my-unique-unit-line)
  963. =>
  964.     (train my-unique-unit-line)
  965.     (set-goal secondary-build 0)
  966. )
  967.  
  968. (defrule
  969.     (goal combat-arm UNIQUE)
  970.     (goal secondary-build 0)
  971.     (civ-selected persian)
  972.     (unit-type-count war-elephant-line < five-percent-pop)
  973.     (can-train-with-escrow war-elephant-line)
  974.     (not (goal upgrade-conflict NOTICE) )
  975. =>
  976.     (release-escrow food)
  977.     (release-escrow gold)
  978.     (train war-elephant-line)
  979.     (set-goal secondary-build 1)
  980. )
  981.  
  982. ;**********************************
  983. ;what if we're all out of gold? 
  984. (defrule
  985.     (current-age == imperial-age)
  986.     (current-age-time > 1800)
  987.     (population < thirty-percent-pop)
  988.     (gold-amount < 100)
  989.     (can-train spearman-line)
  990.     (town-under-attack)
  991. =>
  992.     (train spearman-line)
  993.     (set-goal secondary-build 0)
  994. )
  995.  
  996. (defrule
  997.     (current-age == imperial-age)
  998.     (current-age-time > 1800)
  999.     (population < thirty-percent-pop)
  1000.     (gold-amount < 100)
  1001.     (can-train scout-cavalry-line)
  1002.     (town-under-attack)
  1003. =>
  1004.     (train scout-cavalry-line)
  1005.     (set-goal secondary-build 0)
  1006. )
  1007.  
  1008. (defrule
  1009.     (current-age == imperial-age)
  1010.     (current-age-time > 1800)
  1011.     (population < thirty-percent-pop)
  1012.     (gold-amount < 100)
  1013.     (can-train skirmisher-line)
  1014.     (town-under-attack)
  1015. =>
  1016.     (train skirmisher-line)
  1017.     (set-goal secondary-build 0)
  1018. )
  1019.